use warnings;
use Test::More tests => '26';
use Inline C;

is(init_t(), 0, 'initialize the mac retry queue.');
is(alloc_t(0), 0, 'allocate a entry whose dsn is 0.');
is(alloc_t(1), 0, 'allocate a entry whose dsn is 1.');
is(alloc_t(2), 0, 'allocate a entry whose dsn is 2.');
is(alloc_t(3), 0, 'allocate a entry whose dsn is 3.');
is(alloc_t(4), 0, 'allocate a entry whose dsn is 4.');
is(alloc_t(5), 0, 'allocate a entry whose dsn is 5.');
is(alloc_t(6), 0, 'allocate a entry whose dsn is 6.');
is(alloc_t(7), 0, 'allocate a entry whose dsn is 7.');
is(alloc_t(8), 0, 'allocate a entry whose dsn is 8.');
is(alloc_t(9), 0, 'allocate a entry whose dsn is 9.');
is(alloc_t(10), -1, 'now the queue is full, allocation should be failed.');
is(alloc_t(11), -1, 'now the queue is full, allocation should be failed.');

is(free_t(0), 0, 'free the entry whose dsn is 0.');
is(free_t(1), 0, 'free the entry whose dsn is 1.');
is(free_t(2), 0, 'free the entry whose dsn is 2.');
is(free_t(3), 0, 'free the entry whose dsn is 3.');
is(free_t(4), 0, 'free the entry whose dsn is 4.');
is(free_t(5), 0, 'free the entry whose dsn is 5.');
is(free_t(6), 0, 'free the entry whose dsn is 6.');
is(free_t(7), 0, 'free the entry whose dsn is 7.');
is(free_t(8), 0, 'free the entry whose dsn is 8.');
is(free_t(9), 0, 'free the entry whose dsn is 9.');
is(free_t(0), -1, 'no such entry whose dsn is 0 exists.');
is(free_t(1), -1, 'no such entry whose dsn is 1 exists.');
is(free_t(99), -1, 'no such entry whose dsn is 1 exists.');





__END__
__C__

#include "../../../../mac/mac_retry.h"
#include "../../../../mac/timer.h"
#include "../../../../mac/mac_info.h"
#include "../../../../mac/mac_retry.c"
#include "mac_retry_test.c"
#include "../../../../mac/mem.c"
#include "../../../../mac/list.c"
#include "../../stub/timer_stub.c"
#include "../../../../mac/mac_info.c"

int init_t()
{
    unsigned char r;

    r = retry_init();

    return r;
}

int alloc_t(unsigned char dsn)
{
    return retry_alloc(dsn);     
}

int free_t(unsigned char dsn)
{
    return retry_free(dsn);
}

int find_t(unsigned char dsn)
{
    return retry_find(dsn);
}


